package com.teamwe.movecard.service;

import com.teamwe.movecard.domain.User;
import com.teamwe.movecard.repository.UserRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class UserService {

    @Autowired
    UserRepository userRepo;

    /**
     * 保存用户信息
     * @param user
     */
    public void save(User user){
        userRepo.save(user);
    }

    public User getUser(String mpOpenId){
        return  userRepo.findById(mpOpenId).get();
    }
}
